import Qt 4.7

// Delegate for the detail list
Component {
    BorderImage {
        source: listViewMouseArea.pressed ? "pics/listitem_pressed.png" : "pics/listitem.png"
        width: listView.width
        border.bottom: 5
        border.top: 5
        border.left: 5
        border.right: 30

        Text {
           anchors.left: parent.left
           anchors.leftMargin: 10
           anchors.verticalCenter: parent.verticalCenter
           text: name
           font.pixelSize: Math.round(parent.height/2)
           style: Text.Raised
        }

        Image {
           source: "pics/arrow.png"
           anchors.verticalCenter: parent.verticalCenter
           anchors.right: parent.right
           anchors.rightMargin: 15
        }

        MouseArea {
           id: listViewMouseArea
           anchors.fill: parent

           onClicked: {
               // Switch to details view
               listView.currentIndex = index
               detailViewImage.source = photo
               detailViewName.text = name
               detailViewNumber.text = number
               detailListView.switchState()
           }
        }
    }
}
